/*
 * This source code is part of TWaver 4.0
 *
 * Serva Software PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 * Copyright 2002 - 2011 Serva Software. All rights reserved.
 */

package demo.network.miscellaneous.instrument.element;

import java.awt.Color;
import java.awt.Font;
import java.util.Date;

import demo.network.miscellaneous.instrument.elementui.ClockUI;

import twaver.*;

public class Clock extends ResizableNode {
	
	public final static String CLOCKTIME = "clockTime";
	public final static String HOTSPOT = "hotSpot";
	
    public Clock() {
        super();
        this.init();
    }

    public Clock(Object id) {
        super(id);
        this.init();
    }

    private void init(){
        this.setSize(200, 100);
        Date date = new Date();
        
        this.putClientProperty(CLOCKTIME, date);
        this.putClientProperty(HOTSPOT, new Double(0.7));
        
        this.setName(date.toString());
        this.putLabelYOffset(10);
        this.putLabelColor(Color.YELLOW);
        this.putLabelFont(new Font("Forte", Font.ITALIC, 16));
        this.getAlarmState().setNewAlarmCount(AlarmSeverity.WARNING, 3);
        this.getAlarmState().setPropagateSeverity(AlarmSeverity.CRITICAL);
    }
    
    public String getUIClassID() {
        return ClockUI.class.getName();
    }


}